home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 4 (Reseller) / Apple Ref. & Pres. Lib.v4.0.iso / 2-Graphics / Apple Graphics Source / Apple Graphics Source 2.3 / Apple Graphics Source 2.3 / stack_-1.xml < prev    next >
Extensible Markup Language  |  1990-03-28  |  12KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.3</name>
  5.     <id>-1</id>
  6.     <cardCount>2014</cardCount>
  7.     <cardID>3356</cardID>
  8.     <listID>2937</listID>
  9.     <cantModify><true /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>My notes--If you click the first visible line of the list, and the first--first visible line is not line 1, then the list jumps.--Assign Apple HD20 to the graphics I deleted it from.--Delete Apple from the Keyword index.--SYSTEM MESSAGES------------------------------------------------------on openStackglobal artManagement, firstTimeAGSif the version < 1.2 thendialogIt "Sorry. You need HyperCard version 1.2 or greater." ¬¨&& "You are using version" & the version & "."end ifif firstTimeAGS = empty then--This is the first time you have opened the stack in this--HyperCard session.if the short name of this stack contains "graphics database toolkit"then put true into artManagementelse put false into artManagementend ifshow menubarpass openStackend openStackon closeStackglobal artManagementsaveChanges trueif artManagement thenset cursor to busylock screenset lockMessages to trueset lockRecent to truego cd "title card"send "adminElements false" to this bggo bg "the collection"send "adminElements false" to this bgend ifpass closeStackend closeStackon arrowKey whichKeyset textArrows to not (selectedChunk() = "")pass arrowkeyend arrowKeyon domenu menu                       --// Added by Medior, Inc. 2/20/90global RPStackNameif menu is in "Home,Quit HyperCard" and RPStackName is not empty thenset cursor to watchput RPStackName into shortnamerepeat until offset(":",shortname) = 0delete char 1 to offset(":",shortname) of shortnameend repeatdelete last char of shortnameanswer "This will return to "&shortname&"." with "Cancel" or "OK"if it is "Cancel" then exit domenuset cursor to watchlock screengo RPStackNameunlock screen with dissolveexit domenuelse pass doMenuend domenu--MESSAGE HANDLERS----------------------------------------------------on adminglobal artManagementput true into artManagementsend "adminElements true" to this bgif the cantModify of this stack thendialogIt ¬¨"To use the admin buttons in the background The Collection," && ¬¨"move this stack to an unlocked volume."end ifend adminon closeAdminglobal artManagementput false into artManagementsend "adminElements false" to this bgend closeAdminon showListNameglobal activeListNameif the short name of this bg <> "the collection" thengo bg "the collection"end ifset the name of bg btn id 353 to "List Name:" && activeListNameend showListNameon goListStack thisCard--Takes you to the list stack, or returns "no" if this is unsuccesful.--thisCard, the name of the card in the list stack--you want to go to. is optional.global listStacklock screenset lockMessages to trueset lockRecent to truego stack listStackif the short name of this stack <> listStack then exit to hypercardif cantModify of this stack thendialogIt "The stack" && quote & listStack & quote && "is locked." ¬¨&& "You can't save changes to your lists until you unlock" && ¬¨"the stack" && quote & listStack & quote & "."return "no"end ifif thisCard <> empty then go cd thisCardif the result <> empty then--this card wasn't founddialogIt "The card" && thisCard && "was not found in" && ¬¨"the stack" && listStack && "."return "no"end ifend goListStack--LIST scriptson saveChanges dialogNeeded--dialogNeeded = true if a dialog is needed asking the user--if they want to save changes.global activeListName, taggedList, changesToListif changesToList <> true then exit saveChanges--the exit was made because a save was unnecessary.if dialogNeeded then--the user needs to be asked if they want to save changes.dialogIt "Save changes to the list " ¬¨& quote & activeListName & quote &"?", "No,Yes"if the result is "No" then exit saveChangesend ifput the long name of this cd into afterSaveGoHereif activeListName = "untitled" OR activeListName = empty then--get a name for this list.checkListName "Save the untitled list as (15 letters or less):"if the result <> empty then exit saveChangesend if--you are at the new list card.goListStack activeListNameif the result = "no" thengo afterSaveGoHereexit to hypercardend ifset cursor to busyput taggedList into fld "tagged list"go afterSaveGoHereset cursor to busyput false into changesToListshowListNameend saveChangeson checkListName prompt,default--Returning a non-empty value means the list entered is invalid and--the calling handler needs to exit.global activeListNameif default = "untitled" then put empty into defaultask prompt with defaultput it into whichNameif whichName = empty then return "1"else if not validListName(whichName) thencheckListName prompt,defaultexit checkListNameend if--You're in the list stack.put whichName into activeListNamego last cd of this bgdoMenu "new card"set the name of this cd to activeListNameend checkListNameon dialogIt whichText, whichButtons, whichFont, whichIconif whichButtons = empty then put "OK" into whichButtonsif whichIcon = empty then put "0" into whichIconif whichFont = empty then put "chicago" into whichFontget dialog(whichText,whichButtons,whichIcon,whichFont,plain,12)return itend dialogIt--MENU scripts------------------------------------------------------on buildMenusbuildCatalogMenubuildIndexesMenubuildManagementMenubuildCardMenuend buildMenuson buildCatalogMenuglobal catalogMenuput empty into catalogMenuput "Catalog Volume‚Ķ" & return after catalogMenuput "Catalog Folder‚Ķ" & return after catalogMenuput "Catalog File‚Ķ" & return after catalogMenuif cantModify of this stack thenrepeat with i = 1 to the number of lines in catalogMenuput "(" before line i of catalogMenuend repeatend ifend buildCatalogMenuon buildIndexesMenuglobal indexesMenuput empty into indexesMenuput "Build Keyword Index" & return after indexesMenuput "Add to Keyword Index‚Ķ" & return after indexesMenuput "Delete from Keyword Index‚Ķ" & return after indexesMenuput "Export Keyword Index" & return after indexesMenuput "(-" & return after indexesMenuput "Build Book Index" & return after indexesMenuput "Add to Book Index‚Ķ" & return after indexesMenuput "Delete from Book Index‚Ķ" & return after indexesMenuput "Export Book Index" & return after indexesMenuif cantModify of this stack = true thenrepeat with i = 1 to the number of lines in indexesMenuput "(" before line i of indexesMenuend repeatend ifend buildIndexesMenuon buildManagementMenuglobal managementMenuput empty into managementMenuput "Set Browsing Speed‚Ķ" & return after managementMenuput "Sort by File Name" & return after managementMenuput "(-" & return after managementMenuput "Import Data‚Ķ" & return after managementMenuput "Delete Data" & return after managementMenuif cantModify of this stack thenrepeat with i = 1 to the number of lines in managementMenuput "(" before line i of managementMenuend repeatend ifend buildManagementMenuon buildCardMenuglobal cardMenuput empty into cardMenuput "Build Thumbnail" & return after cardMenuput "(-" & return after cardMenuput "Assign Keyword‚Ķ" & return after cardMenuput "Delete Keyword‚Ķ" & return after cardMenuput "(-" & return after cardMenuput "Assign Book‚Ķ" & return after cardMenuput "Delete Book‚Ķ" & return after cardMenuif cantModify of this stack thenrepeat with i = 1 to the number of lines in cardMenuput "(" before line i of cardMenuend repeatend ifend buildcardMenu--FUNCTIONS----------------------------------------------------------function listDialog thelist,delimit,text,selectMode,theButtonsglobal DialogButton--DialogButton is the name of the button the user clicked to leave--the dialog box.get showList(theList,delimit,text,selectMode,theButtons)put it into theReplyput line 1 of theReply into DialogButtonif DialogButton = "cancel" then return "cancel"delete line 1 of theReplyrepeat with N = 1 to the number of lines in theReplydelete item 2 of line N of theReplyend repeatdelete last char of theReplyreturn theReplyend listDialogfunction sortContainer whichContainer--returns the given container sorted alphabetically.put alphaSort(whichContainer) into itreturn itend sortContainerfunction substitute originalChar, newChar, whichContainer--returns the given container with the given existing character--substituted in all cases for the given new character.repeatput offset(originalChar,whichContainer) into whichCharif whichChar = 0 then exit repeatput newChar into char whichChar of whichContainerend repeatreturn whichContainerend substitutefunction validListName whichNameif whichName = empty then return falseif whichName = "Untitled" thenanswer "List can't be named Untitled."return falseend ifif whichName = "id" thenanswer "Lists can't be named ID."return falseend ifif the length of whichName > 15 thenanswer "List names cannot have more than 15 letters."return falseend ifif nonNegativeNumber(whichName) thendialogIt "List names must contain at least one letter." && ¬¨"The list name" && quote & whichName & quote && "is invalid."return falseend ifgoListStackif the result = "no" thenpop cdexit to hypercardend ifgo bg "lists"repeat with i = 1 to (the number of cds in this bg)if the short name of this cd = whichName thendialogIt "There is already a list named" &&quote& ¬¨whichName &quote& ". Please use a different name."return falseend ifgo next cd of this bgend repeatreturn trueend validListNamefunction positiveWholeNumber whatString--if whatString is a positive whole number, returns true.--Otherwise, returns false.if containsANumber(whatString) = false then return falserepeat with i = 1 to the length of whatStringif "1234567890" contains char i of whatString then next repeat else-- There is at least one non-number so exit now.return falseend ifend repeat--the final testif whatString > 0 then return trueelse return falseend positiveWholeNumberfunction nonNegativeNumber whatString--returns true if the given string is a non-negative number.if containsANumber(whatString) = false then return falserepeat with i = 1 to the length of whatStringif ".1234567890" contains char i of whatString then next repeat else-- if it makes it here, there is an invalid character,-- so exit now.return falseend ifend repeatreturn trueend nonNegativeNumberfunction containsANumber whatString--returns true if at least one of the characters in the--string is a number. Otherwise, returns falserepeat with i = 1 to the length of whatStringif "1234567890" contains char i of whatString then--there is at least one number, so go to the next test.exit repeatelse if i = the length of whatString then--you've gone through all characters & there aren't any numbers.return falseend ifend repeatreturn trueend containsANumberfunction getShortName longName--given the path to a file, this function returns--the name of the filerepeatif longName contains ":" thenput offset (":",longName) into thisChardelete char 1 to thisChar of longNameelse exit repeatend repeatreturn longNameend getShortNamefunction getPath longName--given the full path to a file, this function returns--the path to the file minus the name of the filerepeatif last char of longName <> ":" then delete last char of longNameelse exit repeatend repeatreturn longNameend getPathfunction volumeName pathName--given the full path to a file, this function returns--the name of the volume (i.e., the disk name, or top directory)put empty into theNamerepeat with i = 1 to the number of